#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

vector<vector<int>> merge(vector<vector<int>>& intervals) {
    sort(intervals.begin(), intervals.end(), [](vector<int>& v1, vector<int>& v2) {
        return v1[0] < v2[0];
        });

    vector<vector<int>> ret;
    for (int i = 0; i < intervals.size();)
    {
        int left = intervals[i][0], right = intervals[i][1];
        int j = i + 1;
        while (j < intervals.size() && intervals[j][0] <= right)
        {
            right = max(right, intervals[j][1]);
            ++j;
        }
        ret.push_back({ left , right });
        i = j;
    }

    return ret;
}

int main()
{

	return 0;
}